package com.magold.circuit.module;

import com.magold.circuit.ICircuit;
import com.magold.circuit.ICircuitPath;

public interface CircuitModule {
	
	/**
	 * @return check if connected, this method is used to compute the circuit path state.
	 */
	public boolean isConnected();
	
	/**
	 * callback to inform the module there begin to flow the current.
	 * @precondition: there is no current.
	 * @postcondition: there is current.
	 */
	public void onCurrentBegin();
	
	/**
	 * callback to inform the module there end to flow the current.
	 * @precondition: there is current.
	 * @postcondition: there is no current.
	 */
	public void onCurrentEnd();
	
	/**
	 * callback to inform the module that it has been added to the specified path.
	 * @param pCircuit
	 * @param pPath
	 */
	public void onPathJoined(ICircuit pCircuit, ICircuitPath pPath);
	
	public void setID(int pID);
	public int getID();
	
	public float[] getWireInPosition();
	public float[] getWireOutPosition();
}
